import React, { useState,useContext, createContext } from 'react';
import IndexChilde from './IndexChildren';

//!创建context
export const Context = createContext()

console.log(Context)


export const Example = (props)=>{
    console.log(props.children)
    const [count,setCount] = useState(9)
    return(
        <div>
            <h2>useContext父组件的使用</h2>
            <>
                <Context.Provider value={{count:count,name:'context'}}>
                    {/* {props.children} */}
                    <IndexChilde />
                </Context.Provider>
            </>
        </div>
    )
}